/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.shoppingsystem.view;

import com.shoppingsystem.model.Usuario;
import com.shoppingsystem.view.crud.AlmacenCrud;
import com.shoppingsystem.view.crud.CategoriaCrud;
import com.shoppingsystem.view.crud.ClienteCrud;
import com.shoppingsystem.view.crud.DescuentoCrud;
import com.shoppingsystem.view.crud.DetalleCrud;
import com.shoppingsystem.view.crud.FacturaCrud;
import com.shoppingsystem.view.crud.ItemCrud;
import com.shoppingsystem.view.crud.PagoEfectivoCrud;
import com.shoppingsystem.view.crud.PagoTarjetaCrud;
import com.shoppingsystem.view.crud.PrecioCrud;
import com.shoppingsystem.view.crud.ProductoCrud;
import com.shoppingsystem.view.crud.ProveedorCrud;
import com.shoppingsystem.view.crud.SessionCrud;
import com.shoppingsystem.view.crud.SucursalCrud;
import com.shoppingsystem.view.crud.TerminalCrud;
import com.shoppingsystem.view.crud.UsuarioCrud;
import com.shoppingsystem.view.crud.VentaCrud;
import com.shoppingsystem.view.reports.VisorReportes;
import com.shoppingsystem.view.sales.PanelVentas;
import java.awt.Component;
import java.awt.Cursor;
import java.util.Calendar;
import java.util.Date;
import javax.swing.JInternalFrame;

/**
 *
 * @author Victor Cifuentes (victor.cifuentes@correounivalle.edu.co)
 */
public class PrincipalMDI extends javax.swing.JFrame {

    /**
     * Creates new form PrincipalMDI
     */
    public PrincipalMDI() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        jPopupMenu1 = new javax.swing.JPopupMenu();
        menuBar = new javax.swing.JMenuBar();
        archivoMenu = new javax.swing.JMenu();
        salirMenuItem = new javax.swing.JMenuItem();
        modulosMenu = new javax.swing.JMenu();
        crudMenuItem = new javax.swing.JMenu();
        jMenuItem3 = new javax.swing.JMenuItem();
        almacenMenuItem = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenuItem6 = new javax.swing.JMenuItem();
        jMenuItem7 = new javax.swing.JMenuItem();
        jMenuItem8 = new javax.swing.JMenuItem();
        jMenuItem9 = new javax.swing.JMenuItem();
        jMenuItem10 = new javax.swing.JMenuItem();
        jMenuItem11 = new javax.swing.JMenuItem();
        jMenuItem12 = new javax.swing.JMenuItem();
        jMenuItem13 = new javax.swing.JMenuItem();
        jMenuItem14 = new javax.swing.JMenuItem();
        jMenuItem15 = new javax.swing.JMenuItem();
        jMenuItem16 = new javax.swing.JMenuItem();
        reportesMenuItem = new javax.swing.JMenuItem();
        ventasMenuItem = new javax.swing.JMenuItem();
        ayudaMenu = new javax.swing.JMenu();
        contentMenuItem = new javax.swing.JMenuItem();
        aboutMenuItem = new javax.swing.JMenuItem();
        session = new com.shoppingsystem.model.Session();
        entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("ShoppingSystemPU").createEntityManager();
        desktopPane = new javax.swing.JDesktopPane();

        jPopupMenu1.setName("jPopupMenu1"); // NOI18N

        archivoMenu.setMnemonic('f');
        archivoMenu.setText("General");

        salirMenuItem.setMnemonic('x');
        salirMenuItem.setText("Salir");
        salirMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                salirMenuItemActionPerformed(evt);
            }
        });
        archivoMenu.add(salirMenuItem);

        menuBar.add(archivoMenu);

        modulosMenu.setMnemonic('e');
        modulosMenu.setText("Módulos");

        crudMenuItem.setText("Crud");
        crudMenuItem.setName("crudMenuItem"); // NOI18N

        org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, session, org.jdesktop.beansbinding.ELProperty.create("${usuarioId.rol == 'admin'}"), crudMenuItem, org.jdesktop.beansbinding.BeanProperty.create("enabled"));
        bindingGroup.addBinding(binding);

        jMenuItem3.setText("Usuario");
        jMenuItem3.setName("jMenuItem3"); // NOI18N
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        crudMenuItem.add(jMenuItem3);

        almacenMenuItem.setText("Almacen");
        almacenMenuItem.setName("almacenMenuItem"); // NOI18N
        almacenMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                almacenMenuItemActionPerformed(evt);
            }
        });
        crudMenuItem.add(almacenMenuItem);

        jMenuItem1.setText("Sucursal");
        jMenuItem1.setName("jMenuItem1"); // NOI18N
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        crudMenuItem.add(jMenuItem1);

        jMenuItem2.setText("Terminal");
        jMenuItem2.setName("jMenuItem2"); // NOI18N
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        crudMenuItem.add(jMenuItem2);

        jMenuItem4.setText("Categoria");
        jMenuItem4.setName("jMenuItem4"); // NOI18N
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        crudMenuItem.add(jMenuItem4);

        jMenuItem5.setText("Proveedor");
        jMenuItem5.setName("jMenuItem5"); // NOI18N
        jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem5ActionPerformed(evt);
            }
        });
        crudMenuItem.add(jMenuItem5);

        jMenuItem6.setText("Producto");
        jMenuItem6.setName("jMenuItem6"); // NOI18N
        jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem6ActionPerformed(evt);
            }
        });
        crudMenuItem.add(jMenuItem6);

        jMenuItem7.setText("Session");
        jMenuItem7.setName("jMenuItem7"); // NOI18N
        jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem7ActionPerformed(evt);
            }
        });
        crudMenuItem.add(jMenuItem7);

        jMenuItem8.setText("Precios");
        jMenuItem8.setName("jMenuItem8"); // NOI18N
        jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem8ActionPerformed(evt);
            }
        });
        crudMenuItem.add(jMenuItem8);

        jMenuItem9.setText("Detalles");
        jMenuItem9.setName("jMenuItem9"); // NOI18N
        jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem9ActionPerformed(evt);
            }
        });
        crudMenuItem.add(jMenuItem9);

        jMenuItem10.setText("Descuentos");
        jMenuItem10.setName("jMenuItem10"); // NOI18N
        jMenuItem10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem10ActionPerformed(evt);
            }
        });
        crudMenuItem.add(jMenuItem10);

        jMenuItem11.setText("Cliente");
        jMenuItem11.setName("jMenuItem11"); // NOI18N
        jMenuItem11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem11ActionPerformed(evt);
            }
        });
        crudMenuItem.add(jMenuItem11);

        jMenuItem12.setText("Venta");
        jMenuItem12.setName("jMenuItem12"); // NOI18N
        jMenuItem12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem12ActionPerformed(evt);
            }
        });
        crudMenuItem.add(jMenuItem12);

        jMenuItem13.setText("Item");
        jMenuItem13.setName("jMenuItem13"); // NOI18N
        jMenuItem13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem13ActionPerformed(evt);
            }
        });
        crudMenuItem.add(jMenuItem13);

        jMenuItem14.setText("Factura");
        jMenuItem14.setName("jMenuItem14"); // NOI18N
        jMenuItem14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem14ActionPerformed(evt);
            }
        });
        crudMenuItem.add(jMenuItem14);

        jMenuItem15.setText("Pagos Tarjeta");
        jMenuItem15.setName("jMenuItem15"); // NOI18N
        jMenuItem15.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem15ActionPerformed(evt);
            }
        });
        crudMenuItem.add(jMenuItem15);

        jMenuItem16.setText("Pagos Efectivo");
        jMenuItem16.setName("jMenuItem16"); // NOI18N
        jMenuItem16.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem16ActionPerformed(evt);
            }
        });
        crudMenuItem.add(jMenuItem16);

        modulosMenu.add(crudMenuItem);

        reportesMenuItem.setText("Reportes");
        reportesMenuItem.setName("reportesMenuItem"); // NOI18N
        reportesMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                reportesMenuItemActionPerformed(evt);
            }
        });
        modulosMenu.add(reportesMenuItem);

        ventasMenuItem.setText("Ventas");
        ventasMenuItem.setName("ventasMenuItem"); // NOI18N
        ventasMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ventasMenuItemActionPerformed(evt);
            }
        });
        modulosMenu.add(ventasMenuItem);

        menuBar.add(modulosMenu);

        ayudaMenu.setMnemonic('h');
        ayudaMenu.setText("Ayuda");

        contentMenuItem.setMnemonic('c');
        contentMenuItem.setText("Contenido");
        ayudaMenu.add(contentMenuItem);

        aboutMenuItem.setMnemonic('a');
        aboutMenuItem.setText("Acerca de...");
        ayudaMenu.add(aboutMenuItem);

        menuBar.add(ayudaMenu);

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        desktopPane.setComponentPopupMenu(jPopupMenu1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(desktopPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 614, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(desktopPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
        );

        bindingGroup.bind();

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void salirMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_salirMenuItemActionPerformed

        session.setFechaFin(new Date());
        session.setEstado("Inactiva");
        
        entityManager.getTransaction().begin();
        entityManager.merge(session);
        entityManager.getTransaction().commit();
        System.exit(0);
    }//GEN-LAST:event_salirMenuItemActionPerformed

    private void almacenMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_almacenMenuItemActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        AlmacenCrud almacenCrud = new AlmacenCrud();
        desplegar(almacenCrud, "Almacen");
    }//GEN-LAST:event_almacenMenuItemActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        SucursalCrud sucursalCrud = new SucursalCrud();
        desplegar(sucursalCrud, "Sucursal");
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        TerminalCrud terminalCrud = new TerminalCrud();
        desplegar(terminalCrud, "Terminal");
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        UsuarioCrud usuarioCrud = new UsuarioCrud();
        desplegar(usuarioCrud, "Usuario");
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        CategoriaCrud categoriaCrud = new CategoriaCrud();
        desplegar(categoriaCrud, "Categoria");
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        ProveedorCrud proveedorCrud = new ProveedorCrud();
        desplegar(proveedorCrud, "Proveedor");
    }//GEN-LAST:event_jMenuItem5ActionPerformed

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        ProductoCrud productoCrud = new ProductoCrud();
        desplegar(productoCrud, "Producto");
    }//GEN-LAST:event_jMenuItem6ActionPerformed

    private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        SessionCrud sessionCrud = new SessionCrud();
        desplegar(sessionCrud, "Session");
    }//GEN-LAST:event_jMenuItem7ActionPerformed

    private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        PrecioCrud precioCrud = new PrecioCrud();
        desplegar(precioCrud, "Precios");
    }//GEN-LAST:event_jMenuItem8ActionPerformed

    private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        DetalleCrud detalleCrud = new DetalleCrud();
        desplegar(detalleCrud, "Detalles");
    }//GEN-LAST:event_jMenuItem9ActionPerformed

    private void jMenuItem10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem10ActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        DescuentoCrud descuentoCrud = new DescuentoCrud();
        desplegar(descuentoCrud, "Descuentos");
    }//GEN-LAST:event_jMenuItem10ActionPerformed

    private void jMenuItem11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem11ActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        ClienteCrud clienteCrud = new ClienteCrud();
        desplegar(clienteCrud, "Cliente");
    }//GEN-LAST:event_jMenuItem11ActionPerformed

    private void jMenuItem12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem12ActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        VentaCrud ventaCrud = new VentaCrud();
        desplegar(ventaCrud, "Ventas");
    }//GEN-LAST:event_jMenuItem12ActionPerformed

    private void jMenuItem13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem13ActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        ItemCrud itemCrud = new ItemCrud();
        desplegar(itemCrud, "Items");
    }//GEN-LAST:event_jMenuItem13ActionPerformed

    private void jMenuItem14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem14ActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        FacturaCrud facturaCrud = new FacturaCrud();
        desplegar(facturaCrud, "Factura");
    }//GEN-LAST:event_jMenuItem14ActionPerformed

    private void jMenuItem15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem15ActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        PagoTarjetaCrud pagoTarjetaCrud = new PagoTarjetaCrud();
        desplegar(pagoTarjetaCrud, "Pagos Tajeta");
    }//GEN-LAST:event_jMenuItem15ActionPerformed

    private void jMenuItem16ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem16ActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        PagoEfectivoCrud pagoEfectivoCrud = new PagoEfectivoCrud();
        desplegar(pagoEfectivoCrud, "Pagos Efectivo");
    }//GEN-LAST:event_jMenuItem16ActionPerformed

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened

        Login login = new Login(this, true);
        login.setLocationRelativeTo(this);
        login.setVisible(true);
        
        session.setUsuarioId(login.getUsuario());
        session.setTerminalId(login.getTerminal());
        session.setFechaInicio(new Date());
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DATE, 1);
        session.setFechaFin((cal.getTime()));
        session.setEstado("Activa");
        
        entityManager.getTransaction().begin();
        entityManager.persist(session);
        entityManager.getTransaction().commit();
//        session.setUsuarioId(new Usuario(1, "pruebas", null, null, "activo", "admin"));
        setJMenuBar(menuBar);

    }//GEN-LAST:event_formWindowOpened

    private void reportesMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reportesMenuItemActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        VisorReportes visorReportes = new VisorReportes();
        desplegar(visorReportes, "Reportes");
    }//GEN-LAST:event_reportesMenuItemActionPerformed

    private void ventasMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ventasMenuItemActionPerformed
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        PanelVentas ventas = new PanelVentas();
        desplegar(ventas, "Ventas");
    }//GEN-LAST:event_ventasMenuItemActionPerformed

    private void desplegar(Component component, String titulo) {

        JInternalFrame interFrame = new JInternalFrame(titulo, true, true, true, true);
        interFrame.getContentPane().add(component);
        interFrame.pack();
        interFrame.setVisible(true);
        //interFrame.setLocation(interFrame.getWidth() / 2, interFrame.getHeight() / 2);
        desktopPane.add(interFrame);
        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(PrincipalMDI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(PrincipalMDI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(PrincipalMDI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(PrincipalMDI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new PrincipalMDI().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem aboutMenuItem;
    private javax.swing.JMenuItem almacenMenuItem;
    private javax.swing.JMenu archivoMenu;
    private javax.swing.JMenu ayudaMenu;
    private javax.swing.JMenuItem contentMenuItem;
    private javax.swing.JMenu crudMenuItem;
    private javax.swing.JDesktopPane desktopPane;
    private javax.persistence.EntityManager entityManager;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem10;
    private javax.swing.JMenuItem jMenuItem11;
    private javax.swing.JMenuItem jMenuItem12;
    private javax.swing.JMenuItem jMenuItem13;
    private javax.swing.JMenuItem jMenuItem14;
    private javax.swing.JMenuItem jMenuItem15;
    private javax.swing.JMenuItem jMenuItem16;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JMenuItem jMenuItem9;
    private javax.swing.JPopupMenu jPopupMenu1;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JMenu modulosMenu;
    private javax.swing.JMenuItem reportesMenuItem;
    private javax.swing.JMenuItem salirMenuItem;
    public static com.shoppingsystem.model.Session session;
    private javax.swing.JMenuItem ventasMenuItem;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables
}
